// pages/enterprise/index.js
var { getLoginedUser, fnLoading, fnHideLoading, fnSuccess, fnFail } = require('../../utils/index')
import { domainStatic } from '../../utils/env.js';
import _ from '../../utils/underscore.js';

import { get, fnChoose, lsGetStr, fnUpload, post } from '../../utils/request.js';
import { floatTool, payOrder } from '../../utils/util.js'
import { checkLoginAsyc } from "../../utils/util.js";
const app = getApp()
Page({
  /**
   * 页面的初始数据
   */
  data: {
    titie:[],
  },
item:function(e){
  var id = e.target.dataset.id;
  console.log(id);
  // debugger;
  if(id==14194 || id==14193){
    wx.navigateTo({
      url: '../../pages/soft/index?id='+id,
    })
  }else if(id==14195){
    wx.navigateTo({
      url:"../item/index"
    })
  }
},
  login: function () {
    let that = this;
    console.log(that.data.titie);
    for (var item of that.data.titie) {
      console.log(item.remark);
      that.setData({
        remark: item.remark
      })
    }
    // wx.navigateTo({
    //   url: '../login/index?src=' + that.data.remark,
    // })
  },
  know: function (e) {
    if (e.currentTarget.dataset.id == '14229') {
      var typeId = '980'

    } else {
      var typeId = '981'
    }
    wx.navigateTo({
      url: '../../pages/DetailPags/index?id=' + typeId,

    })
  },

  required:function(e){
   wx.navigateTo({
     url: '../../pages/DetailPags/index?id=' + e.currentTarget.dataset.id,
   })
  },
  /**
     * 生命周期函数--监听页面加载
        */
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  var that=this;
    wx.hideTabBar();
    app.customTabBar()
    Promise.all([
      get({
        path: '/category1/list?type1=330&isShow=1&sortField=order_num&sortOrder=ASC'
      }),
      // get({
      //   path:"info/detail/980"
      // }),
      // get({
      //   path: "info/detail/981"
      // }),

    ])
      .then(function (res) {
        that.setData({
          other: _.sortBy(res[0].slice(1, 3), 'id'),
          // problem:res[1],
        })
      })
      .catch(function (res) {
        fnLoading("请求失败")
      })
      
  },
  
})